package com.bmt.pos.service;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bmt.core.BaseService;
import com.bmt.core.ISaveable;
import com.bmt.core.PageListInfo;
import com.bmt.exception.ServiceException;
import com.bmt.pos.bean.User;
import com.bmt.pos.dao.UserDao;

@Service("userRightService")
public class UserRightService extends BaseService {

	@Autowired
	private UserDao userDao;

	@Autowired
	private UserModuleService userModuleService;

	public void addUser(User user) throws ServiceException {
		try {
			userDao.addUser(user);
		} catch (Exception e) {
			throw new ServiceException("添加失败", e);
		}

	}

	public User getUserById(Integer id) throws ServiceException {
		try {
			return userDao.getUserByColunm("id", id);
		} catch (Exception e) {
			throw new ServiceException("获取失败", e);
		}
	}

	@Override
	public PageListInfo<ISaveable> getPageInfo(int pageNum) throws ServiceException {
		try {
			return userDao.getPageListInfo(pageNum);
		} catch (Exception e) {
			throw new ServiceException("获取失败", e);
		}
	}
	
	

}
